﻿Imports System
Imports System.Runtime.Serialization
Imports System.Security.Permissions

Namespace System.Workflow.ComponentModel.Serialization
    <Serializable> _
    Public Class WorkflowMarkupSerializationException
        Inherits Exception
        ' Methods
        Public Sub New()
            Me.lineNumber = -1
            Me.columnNumber = -1
        End Sub

        Public Sub New(ByVal message As String)
            MyBase.New(message)
            Me.lineNumber = -1
            Me.columnNumber = -1
        End Sub

        Protected Sub New(ByVal info As SerializationInfo, ByVal context As StreamingContext)
            MyBase.New(info, context)
            Me.lineNumber = -1
            Me.columnNumber = -1
        End Sub

        Public Sub New(ByVal message As String, ByVal innerException As Exception)
            MyBase.New(message, innerException)
            Me.lineNumber = -1
            Me.columnNumber = -1
        End Sub

        Public Sub New(ByVal message As String, ByVal lineNumber As Integer, ByVal columnNumber As Integer)
            MyBase.New(message)
            Me.lineNumber = -1
            Me.columnNumber = -1
            Me.lineNumber = lineNumber
            Me.columnNumber = columnNumber
        End Sub

        Public Sub New(ByVal message As String, ByVal innerException As Exception, ByVal lineNumber As Integer, ByVal columnNumber As Integer)
            MyBase.New(message, innerException)
            Me.lineNumber = -1
            Me.columnNumber = -1
            Me.lineNumber = lineNumber
            Me.columnNumber = columnNumber
        End Sub

        <SecurityPermission(SecurityAction.LinkDemand, Flags:=SecurityPermissionFlag.SerializationFormatter)> _
        Public Overrides Sub GetObjectData(ByVal info As SerializationInfo, ByVal context As StreamingContext)
            MyBase.GetObjectData(info, context)
        End Sub


        ' Properties
        Public ReadOnly Property LineNumber As Integer
            Get
                Return Me.lineNumber
            End Get
        End Property

        Public ReadOnly Property LinePosition As Integer
            Get
                Return Me.columnNumber
            End Get
        End Property


        ' Fields
        Private columnNumber As Integer
        Private lineNumber As Integer
    End Class
End Namespace

